package study;

public class TestThreadLocal {
    public static void main(String[] args) {
        ThreadLocal<String>threadLocal = new ThreadLocal<>();
        threadLocal.set("haha");
        new Thread(){
            @Override
            public void run() {
               String a= threadLocal.get();
                System.out.println(Thread.currentThread().getName()+"::"+a);
            }
        }.start();
        String string = threadLocal.get();
        System.out.println(string);

    }
}
